package cn.wolfcode.query;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

@Setter
@Getter
public class QueryObject {
    private String keyword ;
    private int currentPage=1 ;
    private int pageSize=5;

    public int getStart(){
        return (currentPage-1)*pageSize;
    }

    public String getKeyword() {
        if (StringUtils.hasText(keyword)) {
            return keyword.trim().replaceAll(" ", "");
        }
        return null;
    }
}
